from django import template
register = template.Library()

@register.inclusion_tag('local-menu.html')
def local_menu(menu):
	return menu

@register.inclusion_tag('local-menu.html')
def profile_local_menu():
	menu = [
		{ 
			'title': 'View',
			'href': '/accounts/profile/view',
			'class': 'active',
		},
		{ 
			'title': 'Edit',
			'href': '/accounts/profile/edit',
			'class': '',
		},
	]
	return { 'menu': menu }
    
    
class NavSelectedNode(template.Node):
    def __init__(self, url):
        self.url = url

    def render(self, context):
        path = context['request'].path
        if path.startswith(pValue):
            return 'active'
        return ''
